package nz.ac.massey.doi_information_extractor.data;

import java.util.ArrayList;

/**
 * This class represents the list of authors that contributed to a paper, and which author submitted the publication to the system.
 */
@SuppressWarnings("serial")
public class AuthorList extends ArrayList<Author> {

	// Integer of the index of the staff that submitted the publication
	private int staffSubmitter = -1;


	public void setStaffSubmitter(int staffSubmitter) {
		this.staffSubmitter = staffSubmitter;
	}

	public int getStaffSubmitter() {
		return staffSubmitter;
	}

	/**
	 * Creates a string of the list of the list of authors contained in the list
	 * @return String of the list of authors contained in the list
	 */
	public String getAuthorsString(){
		String authorsString = "";

		for(int index = 0; index < this.size(); index++){
			authorsString += this.get(index).getAuthorLastName() +", " + this.get(index).getAuthorFirstName().charAt(0);
			if(index == this.size() -1){
				authorsString += ".";
			}
			else{
				authorsString += ", ";
			}
		}
		return authorsString;
	}
}
